package cn.wusifx.zabbix.request.builder.host;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.CreateRequestBuilder;

import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/hostinterface/create
 */
public class HostInterfaceCreateRequestBuilder extends CreateRequestBuilder {
    private String hostId;
    private String dns;
    private String ip;
    private Integer main;
    private String port;
    private Integer type;
    private Integer useIp;
    public HostInterfaceCreateRequestBuilder(String auth) {
        super("hostinterface.create", auth);
    }

    public HostInterfaceCreateRequestBuilder(Long id, String auth) {
        super("hostinterface.create", id, auth);
    }

    public String getHostId() {
        return hostId;
    }

    public HostInterfaceCreateRequestBuilder setHostId(String hostId) {
        this.hostId = hostId;
        return this;
    }

    public String getDns() {
        return dns;
    }

    public HostInterfaceCreateRequestBuilder setDns(String dns) {
        this.dns = dns;
        return this;
    }

    public String getIp() {
        return ip;
    }

    public HostInterfaceCreateRequestBuilder setIp(String ip) {
        this.ip = ip;
        return this;
    }

    public Integer getMain() {
        return main;
    }

    public HostInterfaceCreateRequestBuilder setMain(Integer main) {
        this.main = main;
        return this;
    }

    public String getPort() {
        return port;
    }

    public HostInterfaceCreateRequestBuilder setPort(String port) {
        this.port = port;
        return this;
    }

    public Integer getType() {
        return type;
    }

    public HostInterfaceCreateRequestBuilder setType(Integer type) {
        this.type = type;
        return this;
    }

    public Integer getUseIp() {
        return useIp;
    }

    public HostInterfaceCreateRequestBuilder setUseIp(Integer useIp) {
        this.useIp = useIp;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("hostid",hostId);
        baseRequest.getParams().put("dns",dns);
        baseRequest.getParams().put("ip",ip);
        baseRequest.getParams().put("main",main);
        baseRequest.getParams().put("port",port);
        baseRequest.getParams().put("type",type);
        baseRequest.getParams().put("useip",useIp);
        return baseRequest;
    }
}
